typescript-eslint 意外とサックリ導入できそうだった
code:.eslintrc.js
module.exports = {
extends: [
// ESLint のオススメに従う
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier/@typescript-eslint",
"plugin:react/recommended"
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: "."
},
plugins: [
"@typescript-eslint",
"prettier",
"jest",
"react",
"react-hooks"
],
rules: {
// SFC とかでも型を書けというのはやっかいなので
"@typescript-eslint/explicit-function-return-type": "off",
// TS なので不要
"react/prop-types": "off",
"react-hooks/rules-of-hooks": "error"
},
settings: {
react: {
version: "detect"
}
},
env: {
"jest/globals": true
}
}